package com.hunk.excel;

import java.util.ArrayList;
import java.util.List;

/**
 * 保存Excel字段的配置信息
 * @author HunkDeng
 */
public class PoiField {
	/** excel中字段在行的位置 **/
	protected int colNumberInExcel;
	/** 字段的名字 **/
	protected String fieldNameInClass;
	/** 字段的类型 **/
	protected String fieldType;
	/** 此字段是否需要保存 **/
	protected boolean needSave = true;
	/** 处理器集合 **/
	private List<Processor> processors = new ArrayList<Processor>();
	
	public boolean isDateType() {
		return "java.util.Date".equals(fieldType);
	}

	public void setColNumberInExcel(int colNumberInExcel) {
		this.colNumberInExcel = colNumberInExcel;
	}

	public void setFieldNameInClass(String fieldNameInClass) {
		this.fieldNameInClass = fieldNameInClass;
	}

	public void setFieldType(String fieldType) {
		this.fieldType = fieldType;
	}
	
	public void setNeedSave(boolean needSave) {
		this.needSave = needSave;
	}

	@Override
	public String toString() {
		return "PoiField [colNumberInExcel=" + colNumberInExcel
				+ ", fieldNameInClass=" + fieldNameInClass + ", fieldType="
				+ fieldType + "]";
	}

	public List<Processor> getProcessors() {
		return processors;
	}	
}
